import Vue from 'vue'
import Router from 'vue-router'

// 懒加载方式，当路由被访问的时候才加载对应组件
const Home = resolve => require(['@/views/Home'], resolve)
const mock = resolve => require(['@/components/mock'], resolve)
const tree = resolve => require(['@/views/tree'], resolve)
const main = resolve => require(['@/views/layout/main'], resolve)
const content = resolve => require(['@/views/content'], resolve)
const Database_demo = resolve => require(['@/views/basic_button'], resolve)
const transfer = resolve => require(['@/views/transfer'], resolve)
const bigger_data2 = resolve => require(['@/views/bigger_data2'], resolve)
const Table = resolve => require(['@/components/Table'], resolve)
const login = resolve => require(['@/views/Login'], resolve)

//import login from '@/views/login/login.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
        path: '/',
        component: login,
        name: '',
        hidden: true
    },
     {
        path: '/Home',
        component: Home,
        name: 'Home',
        children: [
            { path: '/', component: main, name: '主页', hidden: true },
            { path: '/Database_demo', component: Database_demo, name: 'Database_demo' },
            {
				    	path:'/bigger_data2',
				    	name:'/bigger_data2',
				    	component:bigger_data2
				    },
				    {
				      path: '/transfer',
				      name: '/transfer',
				      component: transfer
				  },{
				    path: '/mock',
				   name: '/table',
				   component: mock
				  },{
				      path: '/tree',
				      name: '/tree',
				      component: tree
				    }
				  ,{
				      path: '/Table',
				      name: '/Table',
				      component: Table
				    }
        ]}
  ]
})
